/* pfs00KeepAlive.cpp
 *
 * --
 * Copyright (c) 2012, Christophe Huriaux
 * Distributed under the terms of the MIT license.
 * http://www.opensource.org/licenses/mit-license.php
 * --
 */

#include <packet/pfs00KeepAlive.h>
#include <wrapper/JavaStreamWrapper.h>

pfs00KeepAlive::pfs00KeepAlive()
    : McPacketFromServer(0x00), id(0)
{
}

unsigned int pfs00KeepAlive::length()
{
    return 1 + 4;
}

int16_t pfs00KeepAlive::setField(uint8_t field, void* value)
{

    switch (field)
    {
        case 0:
        default: return 4;
        case 1: id = JavaStreamWrapper::readInt(value); return -1;
    }
}

int32_t pfs00KeepAlive::getId()
{
    return id;
}


